package cn.koala.key.api;

import cn.koala.key.common.feign.BaseApi;
import cn.koala.key.complaint.entity.dto.ComplaintSearchDTO;
import cn.koala.key.common.enums.EnumKeyValue;
import cn.koala.key.complaint.entity.vo.*;
import cn.seed.common.core.Result;
import cn.seed.common.core.ResultList;
import feign.Param;
import feign.RequestLine;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * 客户投诉api。
 *
 * @author liutao
 * @date 2021/1/14
 */
public interface ComplaintApi extends BaseApi {


    @RequestLine("POST /complaintOrder/create?oprNo={oprNo}&oprName={oprName}")
    Result<?> addComplaintOrder(CustomerComplaintOrderVO complaintOrderDetailVO, @Param("oprNo") String oprNo, @Param("oprName") String oprName);

    @RequestLine("POST /complaintOrder/processing?orderNo={orderNo}&oprNo={oprNo}&oprName={oprName}")
    Result<?> processComplaintOrder(@Param("orderNo") String orderNo, @Param("oprNo") String oprNo, @Param("oprName") String oprName);

    @RequestLine("POST /complaintOrder/commit?oprNo={oprNo}&oprName={oprName}")
    Result<?> commitCompliantOrder(@RequestBody CustomerComplaintOrderSubmitVO complaintOrderResultVO, @Param("oprNo") String oprNo, @Param("oprName") String oprName);

    @RequestLine("POST /complaintOrder/city/approve?oprNo={oprNo}&oprName={oprName}")
    Result<?> cityApproveComplaintOrder(@RequestBody CustomerComplaintOrderApproveVO customerComplaintOrderApproveVO, @Param("oprNo") String oprNo, @Param("oprName") String oprName);

    @RequestLine("POST /complaintOrder/hq/approve?oprNo={oprNo}&oprName={oprName}")
    Result<?> hqApproveComplaintOrder(@RequestBody CustomerComplaintOrderApproveVO customerComplaintOrderApproveVO, @Param("oprNo") String oprNo, @Param("oprName") String oprName);

    @RequestLine("GET /complaintOrder/refuseReason?orderNo={orderNo}")
    Result<ComplaintOperateLogVO> getRefuseReason(@Param("orderNo") String orderNo);

    @RequestLine("GET /complaintOrder/operationLog?orderNo={orderNo}")
    Result<List<ComplaintOperateLogVO>> listOperateLogByOrderNo(@Param("orderNo") String orderNo);

    @RequestLine("GET /complaintOrder/getOperateLogById?id={id}")
    Result<ComplaintOperateLogVO> getOperateLogById(@Param("id") Long id);

    @RequestLine("GET /complaintOrder/show?orderNo={orderNo}")
    Result<ComplaintOrderDetailVO> orderDetail(@Param("orderNo") String orderNo);

    @RequestLine("GET /complaintOrder/search")
    Result<ResultList<ComplaintSearchDTO>> searchByCondition(ComplaintSearchVO complaintSearchVO);

    @RequestLine("GET /complaintOrder/fillComplaintOrder?orderNo={orderNo}&repairOrderNo={repairOrderNo}")
    Result<ComplaintOrderFillResultVO> fillComplaintOrder(@Param("orderNo") String orderNo,@Param("repairOrderNo") String repairOrderNo);

    /**
     * 上传客诉附件
     *
     * @param file  文件
     * @param oprNo 操作人
     * @return 附件地址
     */
    @RequestLine("POST complaintOrder/attachment/upload?oprNo={oprNo}")
    Result<String> uploadAttachment(@Param("file") MultipartFile file, @Param("oprNo") String oprNo);

    /**
     * 枚举出投诉分类
     * @return
     */
    @RequestLine("GET complaintOrder/sort/list")
    Result<List<EnumKeyValue>> listComplaintSort();
    @RequestLine("GET complaintOrder/level/list")
    Result<List<EnumKeyValue>> listComplaintLevel();
    @RequestLine("GET complaintOrder/status/list")
    Result<List<EnumKeyValue>> listComplaintStatus();
    @RequestLine("GET complaintOrder/consume/spend/list")
    Result<List<EnumKeyValue>> listComplaintConsumeSpend();
    @RequestLine("GET complaintOrder/source/list")
    Result<List<EnumKeyValue>> listComplaintSource();
    @RequestLine("GET complaintOrder/valid/list")
    Result<List<EnumKeyValue>> listComplaintValid();
}
